<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE HTML>
<html style="height:100%;min-height: 580px;"><head>
  <title>荩美国际商城</title>
  <meta http-equiv="Cache-Control" content="no-cache">
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta name="format-detection" content="telephone=no">
  <meta name="format-detection" content="email=no">
  <link href="/resources/frontcss/goodslist.css" rel="stylesheet" type="text/css">
  <link href="/resources/frontcss/font-awesome.min.css" rel="stylesheet">
  <link href="/resources/frontcss/icono.min.css" rel="stylesheet">
  <link rel="stylesheet" href="/resources/frontcss/swiper.min.css">
  <script src="/resources/js/jquery.min.js" type="text/javascript "></script>
  <script src="/resources/js/swiper.min.js" type="text/javascript "></script>
  <style type="text/css">
    .swiper-pagination-bullet {
      width: 10px;
      height: 10px;
      margin: 0 3px;
      display: inline-block;
      -webkit-border-radius: 50%;
      border-radius: 50%;
      background-color: #AFAFAF;
    }

    .swiper-pagination-bullet-active {
      background-color: #bf2071;
    }
  </style>
</head>
<body>
<body style="overflow-x: hidden;">
<div class="addWrap" style="">
  <p class="curid_p">  本人ID：${user.account}</p>
  <div class="curid"></div>
  <div class="swiper-container swiper-container-horizontal" style="z-index:0">
    <div class="swiper-wrapper" style="transition-duration: 0ms; transform: translate3d(-2400px, 0px, 0px);">
      <c:forEach items="${adverts}" var="e" varStatus="status">
        <div class="swiper-slide" data-swiper-slide-index="${status.index}" style="width: 800px;"><a href="javascript:;"><img class="img-responsive" src="${e.img}" style="height: 180px;width:100%;"></a></div>
      </c:forEach>

       </div>
  </div>
  <div class="swiper-pagination swiper-pagination-clickable" id="position"><span class="swiper-pagination-bullet"></span><span class="swiper-pagination-bullet"></span><span class="swiper-pagination-bullet swiper-pagination-bullet-active"></span><span class="swiper-pagination-bullet"></span></div>
</div>

<div class="goods" style="margin-top: -140px;margin-bottom: -43px;background-color:#ceb88f;">
  <div><img src="/resources/images/goods-bk1.png" class="goods-bk" style="top:102px;"></div>

    <c:forEach items="${data}" var="e">
    <c:set var="images" value="${fn:split(e.images,'|')}"/>
    <div class="goodslw5">
      <p><span class="buy">
        <a href="/front/productDetail?id=${e.id}"  target="_blank" style="border: #c3aa85 1px solid;">领取</a>
      </span>原价${e.marketPrice}<span>限时特惠领取</span></p>

      <a href="/front/productDetail?id=${e.id}">
        <c:forEach items="${images}" var="d" varStatus="status">
          <c:if test="${status.index==0}">
            <img src="${d}" class="goods1">

          </c:if>
        </c:forEach>
      </a>
    </div>
    </c:forEach>


</div>
<%--<div style="text-align: center;margin-bottom:60px;font-family:'宋体';color:#754a2a;background-color:#ceb88f;">
  <img src="/resources/images/qrcode_for_gh_6c087330b0c3_860.jpg" style="height:120px;width:70%;"/>
  <br/>
  深圳荩美生物科技   版权所有
</div>--%>
<div style="display:none;position: fixed;bottom: 50px;height: auto;width: 100%;color:#fff;background-color: #bf2071;border: 1px solid ;
border-radius: 10px;align-self: center;margin: 0 auto;text-align: center;" id="notice">
  <div style="width: 19%;float: left;font-size: 26px;text-align: center;height: 50px;line-height: 50px;border-right: 1px dashed;"
       id="timer">10</div>
  <div style="width: 80%;float: right;font-size: 15px;" id="content"></div>
</div>

<ul class="bottom clearfix">
  <li>
    <img src="/resources/images/menured.svg">
    <p class="active" style="margin-top: 1px;">商城</p>
  </li>
  <li onclick="center()">
    <a class="warn">
      <img src="/resources/images/iwhite.svg">
      <p style="margin-top: 1px;">我的</p>
    </a>
  </li>
</ul>
<script type="text/javascript">
  var timer = 10;
  $(function () {
    //轮播图
    var mySwiper = new Swiper('.swiper-container', {
      loop: true,
      autoplay: 5000,
      pagination: '.swiper-pagination',
      paginationClickable: true,
      speed: 800
    });
    loadNotice();

  });

  function loadNotice(){
    $.ajax({
      url:"/front/loadNotice?r="+Math.random(),
      type:"post",
      success:function(res){
        if(res.success){
          $("#notice").show();
          $("#content").html(res.data.content);
          window.setTimeout(showNotice,1000);
        }
      }
    });
  }

  function showNotice(){
    timer --;
    if(timer>0){
      $("#timer").html("0"+timer);
      window.setTimeout(showNotice,1000);
    }else{
      $("#notice").hide();
    }
  }
</script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js" type="text/javascript"></script>
<script src="/views/front/js/share.js" type="text/javascript"></script>
<script type="text/javascript">
  wxConfig(false);
</script>

<script type="text/javascript">
  function buy(id){
     window.location.href = "/front/cartList?r="+Math.random();
  }
  function center(){
    $.ajax({
      url:"/front/user/toCenter?r="+Math.random(),
      type:"post",
      success:function(res){
        if(res.success){
          window.location.href = "/front/user/main";
        }else{
          alert(res.msg);
          if(res.data=='1'){
            getAuth("");
          }
        }
      },
      error:function(){}
    })
  }
</script>
</body>
</html>